home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / remove.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  2KB  |  78 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: remove.c,v 1.5 1996/08/13 13:56:07 digulla Exp $
  4.     $Log: remove.c,v $
  5.     Revision 1.5  1996/08/13 13:56:07  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.4  1996/08/01 17:41:17  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include "exec_intern.h"
  17.  
  18. /*****************************************************************************
  19.  
  20.     NAME */
  21.     #include <exec/lists.h>
  22.     #include <clib/exec_protos.h>
  23.  
  24.     __AROS_LH1I(void, Remove,
  25.  
  26. /*  SYNOPSIS */
  27.     __AROS_LHA(struct Node *, node, A1),
  28.  
  29. /*  LOCATION */
  30.     struct SysBase *, SysBase, 42, Exec)
  31.  
  32. /*  FUNCTION
  33.     Remove a node from a list.
  34.  
  35.     INPUTS
  36.     node - This node to be removed.
  37.  
  38.     RESULT
  39.  
  40.     NOTES
  41.     There is no need to specify the list but the node must be in
  42.     a list !
  43.  
  44.     EXAMPLE
  45.     struct Node * node;
  46.  
  47.     // Remove node
  48.     Remove (node);
  49.  
  50.     BUGS
  51.  
  52.     SEE ALSO
  53.  
  54.     INTERNALS
  55.  
  56.     HISTORY
  57.     26-08-95    digulla created after EXEC-Routine
  58.     26-10-95    digulla adjusted to new calling scheme
  59.  
  60. ******************************************************************************/
  61. {
  62.     __AROS_FUNC_INIT
  63.     assert (node);
  64.     /*
  65.     Unfortunately, there is no (quick) check that the node
  66.     is in a list.
  67.     */
  68.  
  69.     /*
  70.     Just bend the pointers around the node, ie. we make our
  71.     predecessor point to out successor and vice versa
  72.     */
  73.     node->ln_Pred->ln_Succ = node->ln_Succ;
  74.     node->ln_Succ->ln_Pred = node->ln_Pred;
  75.     __AROS_FUNC_EXIT
  76. } /* Remove */
  77.  
  78.